import request from './request'

// 历史记录相关接口
export class useHistoryApi {
    // 获取问答记录
    async getQuestionRecord(data: any) {
        console.log("调用问答记录查询接口");
        const response: any = await request({
            method: 'post',
            url: '/question/page',
            data
        })
        return response;
    }
    // 批量删除记录
    async deleteBatchRecords(ids: String) {
        console.log("调用问答记录批量删除接口");
        const response: any = await request({
            method: 'delete',
            url: '/question',
            params: {
                ids
            }
        });
        return response;
    }

    // 获取问答详情
    async getQuestionDetail(id: String) {
        console.log("调用问答详情接口");
        const response: any = await request({
            method: 'get',
            url: '/question/detail/' + id,
        });
        return response;
    }

    // 获取历史会话列表
    async getHistoryArray(id: number) {
        console.log("历史会话列表");
        const response: any = await request({
            method: 'get',
            url: '/history/list',
            params: {
                id
            }
        });
        return response;
    }

    // 获取历史会话吸纳关系
    async getHistoryDetail(sessionId: string) {
        console.log("获取历史会话详细");
        const response: any = await request({
            method: 'get',
            url: '/history/detail',
            params: {
                sessionId
            }
        })
        return response;
    }
} 